package month3.day28;

//宠物
public class Pet {
    protected String name;
    private String variety;
    private int physical;

    public Pet() {
        System.out.println("pet的无参构造方法");
    }

    public Pet(String name, String variety, int physical) {
        this.name = name;
        this.variety = variety;
        this.physical = physical;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getVariety() {
        return variety;
    }

    public void setVariety(String variety) {
        this.variety = variety;
    }

    public int getPhysical() {
        return physical;
    }

    public void setPhysical(int physical) {
        this.physical = physical;
    }


    public void print() {
        System.out.println("这是一只宠物，名字叫" + name);
        System.out.println("品种" + variety + ",体重" + this.physical);
    }
    public void eat(){
        System.out.println("吃");
    }
    public void sleep(){
        System.out.println("睡");
    }


}

